<ui:composition template="/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                xmlns:t="http://myfaces.apache.org/tomahawk">
    <ui:define name="customs">
        <script type="text/javascript" src="#{contextPath}/confirmation/confirmation.js"></script>
    </ui:define>
    <ui:define name="title">
    </ui:define>
    <ui:define name="main-content">
        <h:form id="resultFrm" styleClass="wufoo leftLabel">
            <h2><span><h:outputText value="Resultado"/></span></h2>         
            <div id="errorMsgLbl" align="center"><h:messages id="errorMessages" layout="table"/></div>
            <center>
                <h:outputText value="#{confirmationBean.message}" style="color:red;"/> 
                <table style="border: 1px solid #CCCCCC; background: #E3E3E3" width="50%">
                    <tr>
                        <td>                                            
                            <ul>
                                <li class="name">
                                    <label class="desc" for="confirmationNumber">
                                        <h:outputText value="#{resource['attendee.confirmationNumber']}"/>
                                    </label>                    
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.confirmationNumber}"/>
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc">
                                        #{resource['person.fullName']}
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.fullName}"/> 
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc">
                                        <h:outputText value="#{resource['attendee.nickName']}"/>
                                    </label>                    
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.nickName}"/>                                         
                                    </span>
                                </li>                                                                
                                <li class="name">
                                    <label class="desc">
                                        <h:outputText value="#{resource['person.country']}"/>
                                    </label>             
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.country.nationality}"/>
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc">
                                        <h:outputText value="#{resource['attendee.memberId']}"/>
                                    </label>                    
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.memberId}"/><br/>                                  
                                        <h:outputText value="#{confirmationBean.attendee.memberVerification.name}" style="color:red;"/>
                                    </span>
                                </li>                                
                                <li class="name">
                                    <label class="desc" for="residencia">
                                        <h:outputText value="#{resource['person.residence']}"/>
                                    </label>                    
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.residence.name}"/>
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc" for="category">
                                        <h:outputText value="#{resource['attendee.category']}"/>
                                    </label>                    
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.category.description}"/>
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc" for="phone">
                                        <h:outputText value="#{resource['person.phone']}"/>
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.phone}"/>                                        
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc" for="email">
                                        <h:outputText value="#{resource['person.email']}"/>
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.email}"/>
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc" for="job">
                                        <h:outputText value="#{resource['person.job']}"/>
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.job}"/>
                                    </span>
                                </li>
                                <!--li class="name">
                                    <label class="desc" for="arrivalDate">
                                        <h:outputText value="#{resource['attendee.arrival']}"/>
                                    </label>
                                    <span>
                                        <span>
                                            <h:outputText value="Fecha: "/>
                                            <h:outputText value="#{registrationBean.attendee.lodging.arrivalDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>
                                        </span>
                                    </span>                                    
                                    <span>
                                        <h:outputText value="-Via #{registrationBean.attendee.lodging.terminal}-"/>
                                    </span>
                                    <span>
                                        <h:outputText value="#{registrationBean.attendee.lodging.terminalDescription}"/>                                        
                                    </span>
                                </li>
                                <li class="name">
                                    <label class="desc" for="hotel">
                                        <h:outputText value="#{resource['attendee.hotel']}"/>
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.lodging.hotel.name}" rendered="#{confirmationBean.attendee.lodging.hotel != null}"/>
                                    </span>
                                </li-->
                                <li class="name">
                                    <label class="desc" for="comments">
                                        <h:outputText value="#{resource['attendee.comments']}"/>
                                    </label>
                                    <span>
                                        <h:outputText value="#{confirmationBean.attendee.comments}"/>
                                    </span>
                                </li>
                            </ul>
                        </td>
                    </tr>
                </table>
                <div>
                    <h:commandLink onclick="print(#{confirmationBean.attendee.id});" class="button_round">
                        <ins>#{resource['button.print']}</ins>
                    </h:commandLink>
                    <h:commandLink action="#{confirmationBean.cancel}" class="button_round">
                        <ins>#{resource['button.exit']}</ins>
                    </h:commandLink>                    
                </div>
            </center>
            <h:inputHidden id="attendeeId" class="attendeeId" value="#{confirmationBean.attendee.id}"/>
        </h:form>
        <script>
            function print(id){
                window.open('#{contextPath}/print.pdf?id='+ id + '&amp;type=receipt','CONESCAPAN_XXXIII','height=800,width=600,toolbar=no,menubar=no,location=no,resizable=yes');
            }/*
            $(document).ready(function() {
                   print(#{confirmationBean.attendee.id});               
                }); */
            
        </script>
    </ui:define>
</ui:composition>
